// 题目来源：https://iai.sh.cn/problem/13
#include <bits/stdc++.h>
using namespace std;
int a[1000001];
typedef long long LL;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }

  for (int i = 1; i <= n; i++) {
    LL fenzi = 1;
    for (int i = 1; i <= n; i++) {
      LL k = 10000 * a[i];
      fenzi = (fenzi % k * a[i] % k) % k;
    }
    LL p = fenzi / a[i];
    cout << p << endl;
  }

  return 0;
}